package context;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 单例模式下的context
 * @author WUJA13
 *
 */
public class AppContext {

	private static ApplicationContext context;
	public static ApplicationContext getInstance() {
		if(context==null) {
			synchronized (AppContext.class) {
				if(context==null) {
					 context = new ClassPathXmlApplicationContext("applicationContext.xml");
				}
			}
		}
		return context;
	}
}
